feat: use new meta-comment format @ruby:method: for print/puts/p#528
Merged
takaokouji merged 7 commits intodevelopfrom Jan 18, 2026
Merged
feat: use new meta-comment format @ruby:method: for print/puts/p#528takaokouji merged 7 commits intodevelopfrom
takaokouji merged 7 commits intodevelopfrom
Conversation
- Implemented comment support in RubyToBlocksConverter - Added handlers for print, puts, and p in LooksConverter - Added unit tests verifying conversion and comment attachment Closes scratchfoundation#527 Co-Authored-By: Gemini <noreply@google.com>
- Updated Ruby generator to detect '@smalruby:method' comments on looks_say blocks - Implemented conversion back to print, puts, or p based on the meta-comment - Added filtering in the generator to hide @smalruby: meta-comments from output - Added unit tests for looks_say conversion and meta-comment filtering Fixes #528
Split long target.createComment() call into multiple lines to comply with 120 character max-len rule. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Updated _createComment to support minimized parameter (default true) and x/y coordinates - Updated Looks converter to place meta-comments at (200, 0) and minimize them - Added unit tests for comment positioning and minimization
- Updated _onBegin and targetCodeToBlocks to align comment Y-coordinate with block Y-coordinate - Incremented Y-coordinate for sequential statement blocks to prevent overlap - Relaxed test helpers to allow x/y coordinates in blocks
- Remove manual coordinate calculation in RubyToBlocksConverter to trigger GUI auto-layout. - Implement post-layout comment repositioning in Blocks container using workspace.cleanUp(). - Update VM state with new block and comment coordinates after layout. - Update unit tests to omit assertions on block coordinates at the converter level. Co-Authored-By: Gemini <noreply@google.com>
- Update RubyToBlocksConverter to use @ruby:method: directive - Update RubyGenerator to recognize @ruby:method: and filter @ruby: prefix - Remove legacy @smalruby: prefix support and tests as compatibility is not required - Update unit tests to reflect format changes 🤖 Generated with [Gemini Code](https://gemini.google.com/code) Co-Authored-By: Gemini <noreply@google.com>
github-actions bot
pushed a commit
that referenced
this pull request
Jan 18, 2026
…-527-print-puts-p feat: use new meta-comment format @ruby:method: for print/puts/p
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the new meta-comment directive format for print, puts, and p methods as decided in smalruby/smalruby3-develop#24.
Implementation Details
looks_sayblocks from@smalruby:methodNameto@ruby:method:methodName.looks_saygenerator to recognize the new@ruby:method:format.scrub_to filter out comments starting with@ruby:.@smalruby:format.Related Issue
smalruby/smalruby3-develop#24